/**
 * 设置页面样式
 */

* {
  font-family: 'STKaiti', 'KaiTi', serif;
}

.settings-container {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: linear-gradient(180deg, #f5f0e8 0%, #faf8f3 100%);
  box-sizing: border-box;
}

/* 头部 */
.settings-header {
  position: relative;
  width: 100%;
  min-height: 24vh;
  max-height: 240px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 50px;
  padding-bottom: 25px;
  box-sizing: border-box;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: 
    url('../../assets/images/background.jpg') center center / cover no-repeat;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(245, 240, 232, 0.2) 0%, rgba(250, 248, 243, 0.25) 50%, rgba(255, 252, 245, 0.3) 100%);
    pointer-events: none;
  }
  
  &::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
      repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.03) 35px, rgba(255,255,255,.03) 70px);
    animation: patternMove 20s linear infinite;
    pointer-events: none;
  }
}

@keyframes patternMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(70px, 70px);
  }
}

.header-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 40px;
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.header-icon {
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: clamp(2px, 0.5vw, 4px);
  font-family: 'STKaiti', 'KaiTi', serif;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 设置主体 */
.settings-body {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 35px 20px 80px;
  margin-top: -25px;
  background: linear-gradient(180deg, #FAF8F3 0%, #FAF8F3 100%);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.settings-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(139, 69, 19, 0.08);
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  
  &:nth-child(1) { animation-delay: 100ms; }
  &:nth-child(2) { animation-delay: 200ms; }
}

.section-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #6B5438;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid #8C6E4B;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 12px;
  background: rgba(249, 249, 249, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 60px;
  border: 1px solid rgba(139, 69, 19, 0.05);
  overflow: hidden;
  
  &:last-child {
    margin-bottom: 0;
  }
  
  &:active {
    transform: scale(0.98);
    background: rgba(139, 69, 19, 0.08);
  }
}

.setting-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.setting-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.setting-label {
  font-size: 16px;
  color: #333;
  font-weight: 500;
  flex-shrink: 0;
}

.setting-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.setting-value {
  font-size: 14px;
  color: #666;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-arrow {
  font-size: 24px;
  color: #999;
  line-height: 1;
}

/* API Key输入 */
.api-key-input-wrapper {
  margin-top: 12px;
  padding: 16px;
  background: #f0f0f0;
  border-radius: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-container {
  margin-bottom: 12px;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.api-key-input {
  width: 100%;
  background: #fff !important;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #333 !important;
  border: 2px solid #e0e0e0;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
  min-height: 44px;
  line-height: 1.5;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
  
  &:focus {
    border-color: #8C6E4B;
    outline: none;
  }
}

.input-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-cancel,
.btn-save {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-height: 44px;
  
  &:active {
    transform: scale(0.95);
  }
}

.btn-cancel {
  background: #e0e0e0;
  
  .btn-text {
    color: #666;
  }
}

.btn-save {
  background: linear-gradient(135deg, #8C6E4B 0%, #A5875F 100%);
  
  .btn-text {
    color: #fff;
  }
}

.btn-text {
  font-size: 16px;
  font-weight: 600;
}

.input-hint {
  display: block;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
  padding: 10px;
  background: rgba(140, 110, 75, 0.05);
  border-radius: 6px;
  border-left: 3px solid #8C6E4B;
}

/* 底部 */
.settings-footer {
  display: none;
}

.footer-text {
  font-size: 12px;
  color: #999;
  letter-spacing: 1px;
  font-family: 'STKaiti', 'KaiTi', serif;
}

/* 响应式适配 */
@media (max-width: 600px) {
  .settings-header {
    min-height: 22vh;
    max-height: 220px;
  }
}

